<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>增加功能</title>
</h:head>
<ui:param name="bean" value="#{functionRegisterAction}" />
<h:body>
	<center>
		<h:form id="registerForm">
			<p:messages id="messages" showDetail="true" life="10000"/>	
			<p:panel header="增加功能"	style="text-align:center;">
				<h:panelGrid id="registerPanel" columns="2" cellpadding="5" style="margin: 0 auto;">
                    <p:outputLabel value="功能主键" style="text-align:right"/>
                    <p:inputText size="32" maxlength="32" id="id" value="#{bean.function.id}" required="true" style="text-align:left"></p:inputText>
					<p:outputLabel value="功能名称" style="text-align:right"/>
					<p:inputText size="32" maxlength="32" id="name" value="#{bean.function.name}" required="true" style="text-align:left"></p:inputText>
					<p:outputLabel value="所属模块" style="text-align:right"/>
					<p:selectOneMenu value="#{bean.function.modelId}" label="选择模块" style="text-align:left">
						<f:selectItems value="#{bean.modelMap.entrySet()}" var="entry" itemLabel="#{entry.value.description}" itemValue="#{entry.key}" />
					</p:selectOneMenu>		
					<p:outputLabel value="功能地址" style="text-align:right"/>
					<p:inputText size="32" maxlength="64" id="src" value="#{bean.function.src}" required="true" style="text-align:left"></p:inputText>					
					<p:outputLabel value="功能排序" style="text-align:right"/>
					<p:inputText size="32" maxlength="32" id="sort" value="#{bean.function.sort}" required="true" style="text-align:left"></p:inputText>	
					<p:outputLabel value="功能状态" style="text-align:right"/>
					<p:selectOneMenu value="#{bean.function.status}" label="选择模块"  style="text-align:left">
						<f:selectItems value="#{bean.statusMap.entrySet()}" var="entry" itemLabel="#{entry.value}" itemValue="#{entry.key}" />
					</p:selectOneMenu>			
				</h:panelGrid>
				<br/>
				<p:commandButton action="#{bean.add()}" value="增加"	update="registerForm" ajax="true"></p:commandButton>
			</p:panel>
		</h:form>
	</center>
</h:body>
</html>